<?php
namespace Common\Model;
use Think\Model;

class WechatFansModel extends Model{

	/**
	 *  查找一个粉丝
	 *  @param $openid openid
	 */
	public function isFans($openid){
		$where['openid']=$openid;
		
		$result=$this->where($where)->find();
		
		return $result;
	}
	
	/**
	 *  添加一个粉丝
	 *  @param $openid openid
	 */
	public function addFans($data){
		$result=$this->data($data)->add();
	
		return $result;
	}
	
	/**
	 *  更新一个粉丝
	 *  @param $openid openid
	 */
	public function updateFans($openid,$data){
		$where['openid']=$openid;
		$result=$this->where($where)->save($data);
	
		return $result;
	}
	
}
?>